package com.chinasoft.dao;

import com.chinasoft.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountDao {

    @Select("select * from account")
    List<Account> findAll();

    @Select("select * from account where id=#{id}")
    Account findById(Integer id);

    @Insert("insert into account values (#{id},#{name},#{money})")
    public Integer insert(Account account);

    @Update("update account set name=#{name},money=#{money} where id=#{id}")
    public Integer update(Account account);

    @Delete("delete from account where id=#{id}")
    public Integer delete(Integer id);
}